﻿#include "block.h"

Block::Block(){
    setDown(false);
    setFocusPolicy(Qt::NoFocus);
    QPixmap map(":/new/prefix1/SE_project/0.png");
    emptyState = QIcon(map);
}

void Block::setBlock(QIcon nrm,QIcon act){
    normalState = nrm;
    activeState = act;
    setIcon(nrm);
    curState = 0;
}

void Block::setPlayer(QIcon plr)
{
    setIcon(plr);
}

void Block::flushBlock()
{
    setIcon(normalState);
}

void Block::clearBlock()
{
    setIcon(emptyState);
}

void Block::changeState()
{
    if(curState){
        setIcon(normalState);
        curState = 0;
    } else {
        setIcon(activeState);
        curState = 1;
    }
}
